#include "sys.h"
#include "delay.h"
#include "usart.h"
#include "led.h"
#include "beep.h"
#include "timer.h"
#include "usart3.h"
#include "exti.h"
#include "keyboard.h"
#include "EPD_Test.h"
#include "spi.h"

u8 flag1s;

int main(void)
{		
	int i=0;
	NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
	
	delay_init();
	BEEP_Init();
	uart_init(115200);
	usart3_init(115200);
	LED_Init();
	KEY_Init();
	EXTIX_Init();
	TIM3_Int_Init(10-1,7200-1);
	
	MX_SPI1_Init();
	EPD_7in5_V2_test();
	
	while(1)
	{
		KeyDriver();
		UART3_Driver();
		
		if(flag1s)
		{
			flag1s=0;
			LED1 = !LED1;
			LED2 = !LED2;
			
			i++;
			printf("%d\r\n",i);
		}
	}
} 

void KeyAction(unsigned char key)
{
	printf("key=%d %d\r\n",key,KEY0);
}

void Uart3Action(unsigned char key,unsigned char num1,unsigned char num2)
{
	
}


